home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Developer Helper 1: Phil & Dave's Excellent CD
/
XLNT.CD ProDOS.raw
/
UTILITIES:SCSI.UTILITIES
/
STARTUP.bas
< prev
Wrap
BASIC Source File
|
2022-08-05
|
12KB
|
300 lines
10 REM ***********************************************************
20 REM * Hard Disk - SCSI Tester *
30 REM * *
40 REM ***********************************************************
50 REM *
60 REM * By Karl B. Young
70 REM *
71 REM * VERSION DATE Author Comment
72 REM * 1.0A1 30-Jun-86 KBY Alpha release
73 REM * 1.0A2 01-Jul-86 KBY beep at end of test,
74 REM * fix bug in .ASM
75 REM * 1.0B1 30-Jul-86 KBY Beta Release, no changes
76 REM * 1.0B2 04-Aug-86 KBY Upgrade page titles, test 1
77 REM * 1.0 05-Aug-86 KBY Finalize test 2 reallocation
78 REM * 1.1 08-Feb-88 BPA Quit using "BYE"
99 REM *
100 REM ***********************************************************
110 REM * Variable Declarations *
120 REM * *
130 REM ***********************************************************
800 LM = PEEK(106) *256 + PEEK(105)
810 IF LM <12288 THEN 850
820 PRINT "OUT OF MEMORY"
830 END
850 LOMEM: 16384
900 DIM MI$(6),MC(6): REM Machine ID names, caps
910 DIM DS(15),DD(15): REM Disk slot/drive combinations
920 DIM DZ(15),DN$(15): REM Disk size, Disk name (if available)
930 DIM START$(3): REM parts of pinwheel
1000 GOSUB 2000: REM initialize
1010 GOSUB 3000: REM find disks
1020 GOSUB 4000: REM display screen
1030 GOSUB 5000: REM get user's choice
1040 IF QUIT THEN 1100: REM user chose to stop
1050 GOSUB 6000: REM perform test and display result
1060 GOTO 1030
1100 HOME : PRINT CHR$(4);"BYE"
1110 END
2000 REM ************************************************************
2010 REM * Initialization *
2020 REM * *
2030 REM ************************************************************
2100 REM
2110 REM ---- find the machine ID for this machine
2120 REM ---- only ][+,//e can run this program
2130 REM ---- (][ is too old, //c has no slots)
2132 REM ---- Machine ID's:
2133 REM ---- 0-Unkown Apple // (clone?), 1-Apple ][, 2-Apple ][+
2134 REM ---- 3-Apple //e, 4-Apple //e+, 5-Apple //c, 6-Apple //c+
2140 REM ----
2142 FOR I = 0 TO 6: REM Read machine names
2144 READ MI$(I),MC(I)
2146 NEXT I
2150 M1 = PEEK( -1101):M2 = PEEK( -1088):M3 = PEEK( -1089)
2155 IF M1 = 56 AND M2 = 96 AND M3 = 47 THEN MACHINE = 1
2156 IF M1 = 234 AND M2 = 234 AND M3 = 234 THEN MACHINE = 2
2157 IF M1 = 6 AND M2 = 234 AND M3 = 193 THEN MACHINE = 3
2158 IF M1 = 6 AND M2 = 224 AND M3 = 0 THEN MACHINE = 4
2159 IF M1 = 6 AND M2 = 0 AND M3 = 255 THEN MACHINE = 5
2160 IF M1 = 6 AND M2 = 0 AND M3 = 0 THEN MACHINE = 6
2170 M$ = MI$(MACHINE):CAP = MC(MACHINE)
2175 A$ = M$: GOSUB 8100:M$ = A$
2180 IF MACHINE <2 OR MACHINE >4 THEN 9100
2200 REM ----
2210 REM ---- turn off 80-column card, display splash screen
2220 REM ----
2230 PRINT CHR$(12); CHR$(21): REM according to 80-column manual
2240 COL = 40
2300 HOME : REM clear screen
2310 READ A$:V = 5: GOSUB 8200:V = 20: GOSUB 8200: REM border lines
2315 LINE$ = A$
2320 READ A$: GOSUB 8100:V = 10: GOSUB 8200: REM "Apple //"
2325 L0$ = A$
2330 READ A$: GOSUB 8100:V = 12: GOSUB 8200: REM "SCSI TESTER"
2335 L1$ = A$
2340 READ A$: GOSUB 8100:V = 14: GOSUB 8200: REM "copyright"
2345 L2$ = A$
2350 READ A$: GOSUB 8100:V = 16: GOSUB 8200: REM "all rights"
2360 FOR I = 0 TO 3: READ STAR$(I): NEXT I
2370 READ PASS$,FAIL$,ABRT$
2380 READ A$: GOSUB 8100:NNAME$ = A$: REM "No Name Found"
2400 ASM = 12288
2410 PRINT CHR$(4);"BLOAD HD.SCSI.ASM.0"
2999 RETURN
3000 REM ************************************************************
3010 REM * Find SCSI Disks *
3020 REM * *
3030 REM ************************************************************
3100 REM ----
3110 REM ---- call Smartport status 0 to get # of disks
3120 REM ----
3122 POKE ASM +3,1
3125 CALL ASM
3130 NDISKS = PEEK(ASM +5)
3135 IF NDISKS <1 THEN NDISKS = 0: GOTO 3999
3140 I1 = 0
3150 POKE ASM +3,2
3160 FOR I = 1 TO NDISKS
3170 POKE ASM +5,I
3180 CALL ASM
3190 IF PEEK(ASM +4) >0 THEN 3300
3200 I1 = I1 +1
3210 DS(I1) = PEEK(ASM +6):DD(I1) = PEEK(ASM +7)
3220 SIZE = PEEK(ASM +11)
3222 SIZE = SIZE *256 + PEEK(ASM +10)
3224 SIZE = SIZE *256 + PEEK(ASM +9)
3226 SIZE = SIZE *256 + PEEK(ASM +8)
3228 DZ(I1) = SIZE
3230 NL = PEEK(ASM +12)
3240 IF NL = 0 THEN DN$(I1) = NNAME$: GOTO 3300
3245 A$ = ""
3250 FOR I2 = 1 TO NL
3260 A$ = A$ + CHR$( PEEK(ASM +12 +I2))
3270 NEXT I2
3280 DN$(I1) = A$
3300 NEXT I
3310 NDISKS = I1
3999 RETURN
4000 REM ************************************************************
4010 REM * Display the full screen *
4020 REM * *
4030 REM ************************************************************
4100 FOR I = 1 TO 500: NEXT I
4110 HOME
4200 A$ = LINE$:V = 3: GOSUB 8200:V = 20: GOSUB 8200: REM border lines
4210 VTAB 1: HTAB 2: PRINT L1$: REM "SCSI Hard Disk Tester"
4230 A$ = L0$:V = 1: GOSUB 8300: REM "Apple //"
4240 READ A$: VTAB 2: HTAB 2: GOSUB 8100: PRINT A$: REM version #
4242 READ A$:V = 2: GOSUB 8100: GOSUB 8300: REM copyright
4245 VTAB 5
4250 READ A$: GOSUB 8100: HTAB 3: PRINT A$;: REM "Slot"
4260 READ A$: GOSUB 8100: HTAB 7: PRINT A$;: REM "Drive"
4270 READ A$: GOSUB 8100: HTAB 11: PRINT A$;: REM "Name"
4280 READ A$: GOSUB 8100: HTAB 27: PRINT A$: REM "Size"
4282 READ A$: HTAB 3: PRINT A$;
4284 READ A$: HTAB 7: PRINT A$;
4286 READ A$: HTAB 11: PRINT A$;
4288 READ A$: HTAB 27: PRINT A$
4290 READ A$: GOSUB 8100:ZIP$ = A$
4300 VTAB 7
4305 IF NDISKS <1 THEN HTAB 5: PRINT ZIP$;: GOTO 4400
4310 FOR I = 1 TO NDISKS
4320 PRINT TAB( 4);DS(I); TAB( 8);DD(I); TAB( 11);DN$(I); TAB( 27);DZ(I)/2;"K"
4330 NEXT I
4400 CUR = 1
4410 READ A$: GOSUB 8100:USE$ = A$
4412 READ A$: GOSUB 8100:IM$ = A$
4414 READ A$: GOSUB 8100:ARROW$ = A$
4416 READ A$: GOSUB 8100:SELECT$ = A$
4420 READ A$: GOSUB 8100:CR$ = A$
4430 READ A$: GOSUB 8100:ESC$ = A$
4440 READ A$: GOSUB 8100:QUIT$ = A$
4999 RETURN
5000 REM ************************************************************
5010 REM * Get the user's choice *
5020 REM * *
5030 REM ************************************************************
5100 IF NDISKS <2 THEN 5150
5110 VTAB 22: HTAB 2: PRINT USE$;
5120 IF MACHINE >2 THEN PRINT ARROW$;
5130 IF MACHINE <3 THEN PRINT IM$;
5140 PRINT SELECT$
5150 IF NDISKS >0 THEN VTAB 23: HTAB 2: PRINT CR$;
5160 VTAB 24: HTAB 2: PRINT QUIT$;
5200 IF NDISKS <2 THEN 5300
5210 HTAB 2: VTAB 6 +CUR: PRINT "->";
5300 GOSUB 8400
5305 OLDCUR = CUR
5310 IF I$ = "I" OR I$ = "i" THEN CUR = CUR -1
5320 IF I$ = "M" OR I$ = "m" THEN CUR = CUR +1
5330 IF I$ = CHR$(11) THEN CUR = CUR -1
5340 IF I$ = CHR$(10) THEN CUR = CUR +1
5350 IF I$ = CHR$(13) AND NDISKS >0 THEN 5999
5360 IF I$ = CHR$(27) THEN QUIT = 1: GOTO 5999
5370 IF CUR >NDISKS THEN CUR = 1
5380 IF CUR <1 THEN CUR = NDISKS
5390 IF CUR < >OLDCUR THEN HTAB 2: VTAB 6 +OLDCUR: PRINT " "
5400 GOTO 5200
5999 RETURN
6000 REM ************************************************************
6010 REM * Perform the chosen test and display the result. *
6020 REM * *
6030 REM ************************************************************
6100 VTAB 22: HTAB 2: PRINT " ";
6110 VTAB 23: HTAB 2: PRINT " ";
6120 VTAB 24: HTAB 2: PRINT " ";
6130 VTAB 24: HTAB 2: PRINT ESC$;
6140 S = 0
6150 HTAB 36: VTAB 6 +CUR: PRINT " "
6160 POKE ASM +3,3
6165 FOR T = 1 TO 2: REM do test # 1 and # 2
6170 POKE ASM +5,T
6180 POKE ASM +6,DS(CUR): REM slot #
6185 POKE ASM +7,DD(CUR): REM drive #
6190 GOTO 6230
6200 HTAB 38: VTAB 6 +CUR: PRINT STAR$(S)
6202 IF T = T THEN 6210: REM change this to "T<>2" to see progress
6204 T2 = PEEK(ASM +12):T2 = T2 *256 + PEEK(ASM +11):T2 = T2 *256 + PEEK(ASM +10)
6206 VTAB 23: HTAB 5: PRINT T2/2;
6210 S = S +1: IF S >3 THEN S = 0
6220 GOSUB 8400: IF I$ = CHR$(27) THEN 6300
6225 POKE ASM +3,4
6230 GOSUB 6400: REM call test
6240 IF GO THEN 6200
6242 NEXT T
6245 PRINT CHR$(7)
6250 HTAB 36: VTAB 6 +CUR: PRINT RES$
6260 RETURN
6300 REM *
6301 REM * Abort test
6302 REM *
6305 GOSUB 6600: REM send END TEST to ASM
6310 HTAB 36: VTAB 6 +CUR: PRINT ABRT$
6320 RETURN
6400 REM *
6401 REM * Call the test, return result
6402 REM *
6410 CALL ASM
6420 IF PEEK(ASM +4) >0 THEN GO = 0:RES$ = FAIL$: GOTO 6499
6430 IF PEEK(ASM +8) = 0 THEN GO = 0:RES$ = PASS$: GOTO 6499
6440 GO = 1
6499 RETURN
6600 REM *
6601 REM * terminate the test by sending END TEST to ASM
6602 REM *
6610 POKE ASM +3,5
6620 GOSUB 6400
6630 RETURN
6999 RETURN
8100 IF CAP = 0 THEN RETURN
8110 A0$ = ""
8120 FOR A = 1 TO LEN(A$)
8125 A0 = ASC( MID$ (A$,A,1))
8130 IF A0 <97 OR A0 >122 THEN A0$ = A0$ + CHR$(A0): GOTO 8140
8135 A0$ = A0$ + CHR$(A0 -32)
8140 NEXT A
8150 A$ = A0$
8160 RETURN
8200 REM ----
8210 REM ---- center string (A$) on line v
8220 REM ----
8230 A0 = LEN(A$)
8240 VTAB V: HTAB INT((COL -A0)/2) +1
8250 PRINT A$;
8260 RETURN
8300 REM ----
8310 REM ---- right justify string (A$) on line v
8320 REM ----
8330 VTAB V: HTAB COL - LEN(A$)
8340 PRINT A$;
8350 RETURN
8400 REM ----
8410 REM ---- input routine
8420 REM ----
8430 KEY = PEEK( -16384)
8440 POKE -16368,0
8450 IF KEY <128 THEN KEY = 32
8460 IF KEY >127 THEN KEY = KEY -128
8470 I$ = CHR$(KEY)
8480 RETURN
9000 REM ***********************************************************
9010 REM * Error Routines *
9020 REM * *
9030 REM ***********************************************************
9100 REM ----
9110 REM ---- wrong kind of machine
9120 REM ----
9130 A$ = "I'm sorry, but this program won't run on ": GOSUB 8100
9140 HOME : PRINT CHR$(7);A$;M$
15000 REM ***********************************************************
15010 REM * Data Statements *
15020 REM * *
15030 REM ***********************************************************
15100 DATA "this type of machine",1
15101 DATA "an Apple ][",1
15102 DATA "an Apple ][+",1
15103 DATA "an Apple //e",0
15104 DATA "an Apple //e enhanced",0
15105 DATA "an Apple //c",0
15106 DATA "an Apple //c enhanced",0
15120 REM ----
15121 REM ---- splash screen
15122 REM ----
15130 DATA "______________________________________": REM solid line
15132 DATA "Apple //"
15134 DATA "SCSI Hard Disk Tester"
15136 DATA "Copyright Apple Computer, 1986"
15138 DATA "All rights reserved"
15150 DATA "|","/","-","\"
15160 DATA "Pass","Fail","----"
15170 DATA "No Name Found"
15300 DATA "Version 1.0"
15306 DATA "(c) Apple, 1986"
15307 DATA "Slt","Drv","Name","Size"
15308 DATA "===","===","===============","===="
15309 DATA "No SCSI disks found"
15310 DATA "Use ","I & M keys","arrows"," to select the disk"
15320 DATA "Press RETURN to test disk"
15330 DATA "Press ESC to stop testing"
15340 DATA "Press ESC to quit "